-- cmd_buy_goods
-- Create by panyl
-- 购买商城物品

function Operation.cmd_buy_goods(goodsId)
    if DungeonM.isInDungeon() and not DungeonM.isPause() then
        return DungeonActionM.go("buy_market_goods", 1, goodsId);
    end
    
    -- 非地牢内操作
    if not MarketM.buyGoods(goodsId) then
        return;
    end

    -- 记录起来，需要进行同步
    local v = { goods_id = goodsId, };
    SyncM.addMessage("CMD_BUY_GOODS", v);
    SyncM.startSync();
end
